package com.ikangtai.shecare.personal;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

import com.ikangtai.shecare.R;

import java.util.Locale;

/**
 * Created by lijinyuan on 16/6/16.
 */
public class GuideImgActivity extends Activity {
    private ImageView imageView;
    int count = 0;

    private int img[];

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_guide_img);

        switch (Locale.getDefault().getLanguage()) {
            case "zh":
                img = new int[]{R.drawable.operation_guide_1, R.drawable.operation_guide_2,
                        R.drawable.operation_guide_3, R.drawable.operation_guide_4,
                        R.drawable.operation_guide_5, R.drawable.operation_guide_6, R.drawable.operation_guide_7};
                break;
            case "en":
                img = new int[]{R.drawable.operation_guide_1_en, R.drawable.operation_guide_2_en,
                        R.drawable.operation_guide_3_en, R.drawable.operation_guide_4_en,
                        R.drawable.operation_guide_5_en, R.drawable.operation_guide_6_en, R.drawable.operation_guide_7_en};
                break;
            default:
                img = new int[]{R.drawable.operation_guide_1, R.drawable.operation_guide_2,
                        R.drawable.operation_guide_3, R.drawable.operation_guide_4,
                        R.drawable.operation_guide_5, R.drawable.operation_guide_6, R.drawable.operation_guide_7};
                break;
        }


        imageView = (ImageView)

                findViewById(R.id.guide_img);

        imageView.setOnClickListener(new View.OnClickListener()

                                     {
                                         @Override
                                         public void onClick(View v) {
                                             if (count > 5) {
                                                 finish();
                                             } else {
                                                 imageView.setImageResource(img[++count % img.length]);
                                             }
                                         }
                                     }

        );

    }
}
